package com.fm.socketserver;

import java.util.concurrent.BlockingQueue;

public class NrmAlarmProducer implements Runnable {
	private final BlockingQueue<NrmAlarmInfo> alarmQueue;
	public NrmAlarmProducer(BlockingQueue<NrmAlarmInfo> queue){
		alarmQueue=queue;
	}
	public void run() {
		try{
			while(true){
				NrmAlarmInfo alarm=new NrmAlarmInfo("test1","test2","test3","test4","test5","test6","test7","test8");
			    produceAlarm(alarm);
			    Thread.sleep(60000);
			}
		}catch(InterruptedException e){
			Thread.currentThread().interrupt();
		}
	}
	
	private void produceAlarm(NrmAlarmInfo alarm) throws InterruptedException{
		alarmQueue.put(alarm);
	}

}
